home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Hacks / Hacks ’87 / Source ƒ.sit / Source ƒ / XLISP ƒ / XLISP 1.7 C SRCS / macfun.c < prev    next >
MacBinary  |  1987-05-09  |  7.9 KB  |  [TEXT/EDIT]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Sat May 9 12:09:16 1987, modified Sat May 9 12:09:16 1987, creator Macintosh Edit, type ASCII, 7332 bytes "macfun.c" , at 0x1d24 388 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[EDIT]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 08 6d 61 63 66 75 6e | 2e 63 00 00 00 00 00 00 |..macfun|.c......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 45 44 49 | 54 01 00 00 00 00 00 00 |.TEXTEDI|T.......|
|00000050| 00 00 00 00 00 1c a4 00 | 00 01 84 9c c9 05 2c 9c |........|......,.|
|00000060| c9 05 2c 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..,.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 75 73 00 00 |........|....us..|
|00000080| 2f 2a 20 6d 61 63 66 75 | 6e 2e 63 20 2d 20 6d 61 |/* macfu|n.c - ma|
|00000090| 63 69 6e 74 6f 73 68 20 | 75 73 65 72 20 69 6e 74 |cintosh |user int|
|000000a0| 65 72 66 61 63 65 20 66 | 75 6e 63 74 69 6f 6e 73 |erface f|unctions|
|000000b0| 20 66 6f 72 20 78 6c 69 | 73 70 20 2a 2f 0d 0d 23 | for xli|sp */..#|
|000000c0| 69 6e 63 6c 75 64 65 20 | 22 78 6c 69 73 70 2e 68 |include |"xlisp.h|
|000000d0| 22 0d 23 69 6e 63 6c 75 | 64 65 20 3c 6d 65 6d 2e |".#inclu|de <mem.|
|000000e0| 68 3e 0d 23 69 6e 63 6c | 75 64 65 20 3c 71 64 2e |h>.#incl|ude <qd.|
|000000f0| 68 3e 0d 0d 6f 76 65 72 | 6c 61 79 20 22 6d 61 63 |h>..over|lay "mac|
|00000100| 73 74 75 66 66 22 0d 0d | 2f 2a 20 65 78 74 65 72 |stuff"..|/* exter|
|00000110| 6e 61 6c 20 76 61 72 69 | 61 62 6c 65 73 20 2a 2f |nal vari|ables */|
|00000120| 0d 65 78 74 65 72 6e 20 | 4e 4f 44 45 20 2a 2a 2a |.extern |NODE ***|
|00000130| 78 6c 73 74 61 63 6b 3b | 0d 65 78 74 65 72 6e 20 |xlstack;|.extern |
|00000140| 47 72 61 66 50 74 72 20 | 63 77 69 6e 64 6f 77 2c |GrafPtr |cwindow,|
|00000150| 67 77 69 6e 64 6f 77 3b | 0d 0d 2f 2a 20 66 6f 72 |gwindow;|../* for|
|00000160| 77 61 72 64 20 64 65 63 | 6c 61 72 61 74 69 6f 6e |ward dec|laration|
|00000170| 73 20 2a 2f 0d 46 4f 52 | 57 41 52 44 20 4e 4f 44 |s */.FOR|WARD NOD|
|00000180| 45 20 2a 64 6f 5f 30 28 | 29 3b 0d 46 4f 52 57 41 |E *do_0(|);.FORWA|
|00000190| 52 44 20 4e 4f 44 45 20 | 2a 64 6f 5f 31 28 29 3b |RD NODE |*do_1();|
|000001a0| 0d 46 4f 52 57 41 52 44 | 20 4e 4f 44 45 20 2a 64 |.FORWARD| NODE *d|
|000001b0| 6f 5f 32 28 29 3b 0d 0d | 2f 2a 20 70 6f 77 20 2d |o_2();..|/* pow -|
|000001c0| 20 66 61 6b 65 20 70 6f | 77 65 72 20 66 75 6e 63 | fake po|wer func|
|000001d0| 74 69 6f 6e 20 2a 2f 0d | 70 6f 77 28 29 0d 7b 0d |tion */.|pow().{.|
|000001e0| 20 20 20 20 78 6c 66 61 | 69 6c 28 22 66 75 6e 63 | xlfa|il("func|
|000001f0| 74 69 6f 6e 20 6e 6f 74 | 20 61 76 61 69 6c 61 62 |tion not| availab|
|00000200| 6c 65 22 29 3b 0d 7d 0d | 0d 2f 2a 20 78 68 69 64 |le");.}.|./* xhid|
|00000210| 65 70 65 6e 20 2d 20 68 | 69 64 65 20 74 68 65 20 |epen - h|ide the |
|00000220| 70 65 6e 20 2a 2f 0d 4e | 4f 44 45 20 2a 78 68 69 |pen */.N|ODE *xhi|
|00000230| 64 65 70 65 6e 28 61 72 | 67 73 29 0d 20 20 4e 4f |depen(ar|gs). NO|
|00000240| 44 45 20 2a 61 72 67 73 | 3b 0d 7b 0d 20 20 20 20 |DE *args|;.{. |
|00000250| 72 65 74 75 72 6e 20 28 | 64 6f 5f 30 28 61 72 67 |return (|do_0(arg|
|00000260| 73 2c 27 48 27 29 29 3b | 0d 7d 0d 0d 2f 2a 20 78 |s,'H'));|.}../* x|
|00000270| 73 68 6f 77 70 65 6e 20 | 2d 20 73 68 6f 77 20 74 |showpen |- show t|
|00000280| 68 65 20 70 65 6e 20 2a | 2f 0d 4e 4f 44 45 20 2a |he pen *|/.NODE *|
|00000290| 78 73 68 6f 77 70 65 6e | 28 61 72 67 73 29 0d 20 |xshowpen|(args). |
|000002a0| 20 4e 4f 44 45 20 2a 61 | 72 67 73 3b 0d 7b 0d 20 | NODE *a|rgs;.{. |
|000002b0| 20 20 20 72 65 74 75 72 | 6e 20 28 64 6f 5f 30 28 | retur|n (do_0(|
|000002c0| 61 72 67 73 2c 27 53 27 | 29 29 3b 0d 7d 0d 0d 2f |args,'S'|));.}../|
|000002d0| 2a 20 78 67 65 74 70 65 | 6e 20 2d 20 67 65 74 20 |* xgetpe|n - get |
|000002e0| 74 68 65 20 70 65 6e 20 | 70 6f 73 69 74 69 6f 6e |the pen |position|
|000002f0| 20 2a 2f 0d 4e 4f 44 45 | 20 2a 78 67 65 74 70 65 | */.NODE| *xgetpe|
|00000300| 6e 28 61 72 67 73 29 0d | 20 20 4e 4f 44 45 20 2a |n(args).| NODE *|
|00000310| 61 72 67 73 3b 0d 7b 0d | 20 20 20 20 4e 4f 44 45 |args;.{.| NODE|
|00000320| 20 2a 2a 2a 6f 6c 64 73 | 74 6b 2c 2a 76 61 6c 3b | ***olds|tk,*val;|
|00000330| 0d 20 20 20 20 50 6f 69 | 6e 74 20 70 3b 0d 20 20 |. Poi|nt p;. |
|00000340| 20 20 78 6c 6c 61 73 74 | 61 72 67 28 61 72 67 73 | xllast|arg(args|
|00000350| 29 3b 0d 20 20 20 20 53 | 65 74 50 6f 72 74 28 67 |);. S|etPort(g|
|00000360| 77 69 6e 64 6f 77 29 3b | 0d 20 20 20 20 47 65 74 |window);|. Get|
|00000370| 50 65 6e 28 26 70 29 3b | 0d 20 20 20 20 53 65 74 |Pen(&p);|. Set|
|00000380| 50 6f 72 74 28 63 77 69 | 6e 64 6f 77 29 3b 0d 20 |Port(cwi|ndow);. |
|00000390| 20 20 20 6f 6c 64 73 74 | 6b 20 3d 20 78 6c 73 74 | oldst|k = xlst|
|000003a0| 61 63 6b 3b 0d 20 20 20 | 20 78 6c 73 61 76 65 31 |ack;. | xlsave1|
|000003b0| 28 76 61 6c 29 3b 0d 20 | 20 20 20 76 61 6c 20 3d |(val);. | val =|
|000003c0| 20 63 6f 6e 73 61 28 4e | 49 4c 29 3b 0d 20 20 20 | consa(N|IL);. |
|000003d0| 20 72 70 6c 61 63 61 28 | 76 61 6c 2c 63 76 66 69 | rplaca(|val,cvfi|
|000003e0| 78 6e 75 6d 28 28 46 49 | 58 4e 55 4d 29 70 2e 61 |xnum((FI|XNUM)p.a|
|000003f0| 2e 68 29 29 3b 0d 20 20 | 20 20 72 70 6c 61 63 64 |.h));. | rplacd|
|00000400| 28 76 61 6c 2c 63 76 66 | 69 78 6e 75 6d 28 28 46 |(val,cvf|ixnum((F|
|00000410| 49 58 4e 55 4d 29 70 2e | 61 2e 76 29 29 3b 0d 20 |IXNUM)p.|a.v));. |
|00000420| 20 20 20 78 6c 73 74 61 | 63 6b 20 3d 20 6f 6c 64 | xlsta|ck = old|
|00000430| 73 74 6b 3b 0d 20 20 20 | 20 72 65 74 75 72 6e 20 |stk;. | return |
|00000440| 28 76 61 6c 29 3b 0d 7d | 0d 0d 2f 2a 20 78 70 65 |(val);.}|../* xpe|
|00000450| 6e 6d 6f 64 65 20 2d 20 | 73 65 74 20 74 68 65 20 |nmode - |set the |
|00000460| 70 65 6e 20 6d 6f 64 65 | 20 2a 2f 0d 4e 4f 44 45 |pen mode| */.NODE|
|00000470| 20 2a 78 70 65 6e 6d 6f | 64 65 28 61 72 67 73 29 | *xpenmo|de(args)|
|00000480| 0d 20 20 4e 4f 44 45 20 | 2a 61 72 67 73 3b 0d 7b |. NODE |*args;.{|
|00000490| 0d 20 20 20 20 72 65 74 | 75 72 6e 20 28 64 6f 5f |. ret|urn (do_|
|000004a0| 31 28 61 72 67 73 2c 27 | 4d 27 29 29 3b 0d 7d 0d |1(args,'|M'));.}.|
|000004b0| 0d 2f 2a 20 78 70 65 6e | 73 69 7a 65 20 2d 20 73 |./* xpen|size - s|
|000004c0| 65 74 20 74 68 65 20 70 | 65 6e 20 73 69 7a 65 20 |et the p|en size |
|000004d0| 2a 2f 0d 4e 4f 44 45 20 | 2a 78 70 65 6e 73 69 7a |*/.NODE |*xpensiz|
|000004e0| 65 28 61 72 67 73 29 0d | 20 20 4e 4f 44 45 20 2a |e(args).| NODE *|
|000004f0| 61 72 67 73 3b 0d 7b 0d | 20 20 20 20 72 65 74 75 |args;.{.| retu|
|00000500| 72 6e 20 28 64 6f 5f 32 | 28 61 72 67 73 2c 27 53 |rn (do_2|(args,'S|
|00000510| 27 29 29 3b 0d 7d 0d 0d | 2f 2a 20 78 70 65 6e 70 |'));.}..|/* xpenp|
|00000520| 61 74 20 2d 20 73 65 74 | 20 74 68 65 20 70 65 6e |at - set| the pen|
|00000530| 20 70 61 74 74 65 72 6e | 20 2a 2f 0d 4e 4f 44 45 | pattern| */.NODE|
|00000540| 20 2a 78 70 65 6e 70 61 | 74 28 61 72 67 73 29 0d | *xpenpa|t(args).|
|00000550| 20 20 4e 4f 44 45 20 2a | 61 72 67 73 3b 0d 7b 0d | NODE *|args;.{.|
|00000560| 20 20 20 20 4e 4f 44 45 | 20 2a 70 6c 69 73 74 3b | NODE| *plist;|
|00000570| 0d 20 20 20 20 63 68 61 | 72 20 70 61 74 5b 38 5d |. cha|r pat[8]|
|00000580| 2c 69 3b 0d 20 20 20 20 | 70 6c 69 73 74 20 3d 20 |,i;. |plist = |
|00000590| 78 6c 6d 61 74 63 68 28 | 4c 49 53 54 2c 26 61 72 |xlmatch(|LIST,&ar|
|000005a0| 67 73 29 3b 0d 20 20 20 | 20 78 6c 6c 61 73 74 61 |gs);. | xllasta|
|000005b0| 72 67 28 61 72 67 73 29 | 3b 0d 20 20 20 20 66 6f |rg(args)|;. fo|
|000005c0| 72 20 28 69 20 3d 20 30 | 3b 20 69 20 3c 20 38 20 |r (i = 0|; i < 8 |
|000005d0| 26 26 20 63 6f 6e 73 70 | 28 70 6c 69 73 74 29 3b |&& consp|(plist);|
|000005e0| 20 2b 2b 69 2c 20 70 6c | 69 73 74 20 3d 20 63 64 | ++i, pl|ist = cd|
|000005f0| 72 28 70 6c 69 73 74 29 | 29 0d 09 69 66 20 28 66 |r(plist)|)..if (f|
|00000600| 69 78 70 28 63 61 72 28 | 70 6c 69 73 74 29 29 29 |ixp(car(|plist)))|
|00000610| 0d 09 20 20 20 20 70 61 | 74 5b 69 5d 20 3d 20 63 |.. pa|t[i] = c|
|00000620| 61 72 28 70 6c 69 73 74 | 29 2d 3e 6e 5f 69 6e 74 |ar(plist|)->n_int|
|00000630| 3b 0d 20 20 20 20 53 65 | 74 50 6f 72 74 28 67 77 |;. Se|tPort(gw|
|00000640| 69 6e 64 6f 77 29 3b 0d | 20 20 20 20 50 65 6e 50 |indow);.| PenP|
|00000650| 61 74 28 70 61 74 29 3b | 0d 20 20 20 20 53 65 74 |at(pat);|. Set|
|00000660| 50 6f 72 74 28 63 77 69 | 6e 64 6f 77 29 3b 0d 20 |Port(cwi|ndow);. |
|00000670| 20 20 20 72 65 74 75 72 | 6e 20 28 4e 49 4c 29 3b | retur|n (NIL);|
|00000680| 0d 7d 0d 0d 2f 2a 20 78 | 70 65 6e 6e 6f 72 6d 61 |.}../* x|pennorma|
|00000690| 6c 20 2d 20 73 65 74 20 | 74 68 65 20 70 65 6e 20 |l - set |the pen |
|000006a0| 74 6f 20 6e 6f 72 6d 61 | 6c 20 2a 2f 0d 4e 4f 44 |to norma|l */.NOD|
|000006b0| 45 20 2a 78 70 65 6e 6e | 6f 72 6d 61 6c 28 61 72 |E *xpenn|ormal(ar|
|000006c0| 67 73 29 0d 20 20 4e 4f | 44 45 20 2a 61 72 67 73 |gs). NO|DE *args|
|000006d0| 3b 0d 7b 0d 20 20 20 20 | 78 6c 6c 61 73 74 61 72 |;.{. |xllastar|
|000006e0| 67 28 61 72 67 73 29 3b | 0d 20 20 20 20 53 65 74 |g(args);|. Set|
|000006f0| 50 6f 72 74 28 67 77 69 | 6e 64 6f 77 29 3b 0d 20 |Port(gwi|ndow);. |
|00000700| 20 20 20 50 65 6e 4e 6f | 72 6d 61 6c 28 29 3b 0d | PenNo|rmal();.|
|00000710| 20 20 20 20 53 65 74 50 | 6f 72 74 28 63 77 69 6e | SetP|ort(cwin|
|00000720| 64 6f 77 29 3b 0d 20 20 | 20 20 72 65 74 75 72 6e |dow);. | return|
|00000730| 20 28 4e 49 4c 29 3b 0d | 7d 0d 0d 2f 2a 20 78 6d | (NIL);.|}../* xm|
|00000740| 6f 76 65 74 6f 20 2d 20 | 4d 6f 76 65 20 74 6f 20 |oveto - |Move to |
|00000750| 61 20 73 63 72 65 65 6e | 20 6c 6f 63 61 74 69 6f |a screen| locatio|
|00000760| 6e 20 2a 2f 0d 4e 4f 44 | 45 20 2a 78 6d 6f 76 65 |n */.NOD|E *xmove|
|00000770| 74 6f 28 61 72 67 73 29 | 0d 20 20 4e 4f 44 45 20 |to(args)|. NODE |
|00000780| 2a 61 72 67 73 3b 0d 7b | 0d 20 20 20 20 72 65 74 |*args;.{|. ret|
|00000790| 75 72 6e 20 28 64 6f 5f | 32 28 61 72 67 73 2c 27 |urn (do_|2(args,'|
|000007a0| 6d 27 29 29 3b 0d 7d 0d | 0d 2f 2a 20 78 6d 6f 76 |m'));.}.|./* xmov|
|000007b0| 65 20 2d 20 4d 6f 76 65 | 20 69 6e 20 61 20 73 70 |e - Move| in a sp|
|000007c0| 65 63 69 66 69 65 64 20 | 64 69 72 65 63 74 69 6f |ecified |directio|
|000007d0| 6e 20 2a 2f 0d 4e 4f 44 | 45 20 2a 78 6d 6f 76 65 |n */.NOD|E *xmove|
|000007e0| 28 61 72 67 73 29 0d 20 | 20 4e 4f 44 45 20 2a 61 |(args). | NODE *a|
|000007f0| 72 67 73 3b 0d 7b 0d 20 | 20 20 20 72 65 74 75 72 |rgs;.{. | retur|
|00000800| 6e 20 28 64 6f 5f 32 28 | 61 72 67 73 2c 27 4d 27 |n (do_2(|args,'M'|
|00000810| 29 29 3b 0d 7d 0d 0d 2f | 2a 20 78 6c 69 6e 65 74 |));.}../|* xlinet|
|00000820| 6f 20 2d 20 64 72 61 77 | 20 61 20 4c 69 6e 65 20 |o - draw| a Line |
|00000830| 74 6f 20 61 20 73 63 72 | 65 65 6e 20 6c 6f 63 61 |to a scr|een loca|
|00000840| 74 69 6f 6e 20 2a 2f 0d | 4e 4f 44 45 20 2a 78 6c |tion */.|NODE *xl|
|00000850| 69 6e 65 74 6f 28 61 72 | 67 73 29 0d 20 20 4e 4f |ineto(ar|gs). NO|
|00000860| 44 45 20 2a 61 72 67 73 | 3b 0d 7b 0d 20 20 20 20 |DE *args|;.{. |
|00000870| 72 65 74 75 72 6e 20 28 | 64 6f 5f 32 28 61 72 67 |return (|do_2(arg|
|00000880| 73 2c 27 6c 27 29 29 3b | 0d 7d 0d 0d 2f 2a 20 78 |s,'l'));|.}../* x|
|00000890| 6c 69 6e 65 20 2d 20 64 | 72 61 77 20 61 20 4c 69 |line - d|raw a Li|
|000008a0| 6e 65 20 69 6e 20 61 20 | 73 70 65 63 69 66 69 65 |ne in a |specifie|
|000008b0| 64 20 64 69 72 65 63 74 | 69 6f 6e 20 2a 2f 0d 4e |d direct|ion */.N|
|000008c0| 4f 44 45 20 2a 78 6c 69 | 6e 65 28 61 72 67 73 29 |ODE *xli|ne(args)|
|000008d0| 0d 20 20 4e 4f 44 45 20 | 2a 61 72 67 73 3b 0d 7b |. NODE |*args;.{|
|000008e0| 0d 20 20 20 20 72 65 74 | 75 72 6e 20 28 64 6f 5f |. ret|urn (do_|
|000008f0| 32 28 61 72 67 73 2c 27 | 4c 27 29 29 3b 0d 7d 0d |2(args,'|L'));.}.|
|00000900| 0d 2f 2a 20 78 73 68 6f | 77 67 72 61 70 68 69 63 |./* xsho|wgraphic|
|00000910| 73 20 2d 20 73 68 6f 77 | 20 74 68 65 20 67 72 61 |s - show| the gra|
|00000920| 70 68 69 63 73 20 77 69 | 6e 64 6f 77 20 2a 2f 0d |phics wi|ndow */.|
|00000930| 4e 4f 44 45 20 2a 78 73 | 68 6f 77 67 72 61 70 68 |NODE *xs|howgraph|
|00000940| 69 63 73 28 61 72 67 73 | 29 0d 20 20 4e 4f 44 45 |ics(args|). NODE|
|00000950| 20 2a 61 72 67 73 3b 0d | 7b 0d 20 20 20 20 78 6c | *args;.|{. xl|
|00000960| 6c 61 73 74 61 72 67 28 | 61 72 67 73 29 3b 0d 20 |lastarg(|args);. |
|00000970| 20 20 20 73 63 72 73 70 | 6c 69 74 28 31 29 3b 0d | scrsp|lit(1);.|
|00000980| 20 20 20 20 72 65 74 75 | 72 6e 20 28 4e 49 4c 29 | retu|rn (NIL)|
|00000990| 3b 0d 7d 0d 0d 2f 2a 20 | 78 68 69 64 65 67 72 61 |;.}../* |xhidegra|
|000009a0| 70 68 69 63 73 20 2d 20 | 68 69 64 65 20 74 68 65 |phics - |hide the|
|000009b0| 20 67 72 61 70 68 69 63 | 73 20 77 69 6e 64 6f 77 | graphic|s window|
|000009c0| 20 2a 2f 0d 4e 4f 44 45 | 20 2a 78 68 69 64 65 67 | */.NODE| *xhideg|
|000009d0| 72 61 70 68 69 63 73 28 | 61 72 67 73 29 0d 20 20 |raphics(|args). |
|000009e0| 4e 4f 44 45 20 2a 61 72 | 67 73 3b 0d 7b 0d 20 20 |NODE *ar|gs;.{. |
|000009f0| 20 20 78 6c 6c 61 73 74 | 61 72 67 28 61 72 67 73 | xllast|arg(args|
|00000a00| 29 3b 0d 20 20 20 20 73 | 63 72 73 70 6c 69 74 28 |);. s|crsplit(|
|00000a10| 30 29 3b 0d 20 20 20 20 | 72 65 74 75 72 6e 20 28 |0);. |return (|
|00000a20| 4e 49 4c 29 3b 0d 7d 0d | 0d 2f 2a 20 78 63 6c 65 |NIL);.}.|./* xcle|
|00000a30| 61 72 67 72 61 70 68 69 | 63 73 20 2d 20 63 6c 65 |argraphi|cs - cle|
|00000a40| 61 72 20 74 68 65 20 67 | 72 61 70 68 69 63 73 20 |ar the g|raphics |
|00000a50| 77 69 6e 64 6f 77 20 2a | 2f 0d 4e 4f 44 45 20 2a |window *|/.NODE *|
|00000a60| 78 63 6c 65 61 72 67 72 | 61 70 68 69 63 73 28 61 |xcleargr|aphics(a|
|00000a70| 72 67 73 29 0d 20 20 4e | 4f 44 45 20 2a 61 72 67 |rgs). N|ODE *arg|
|00000a80| 73 3b 0d 7b 0d 20 20 20 | 20 78 6c 6c 61 73 74 61 |s;.{. | xllasta|
|00000a90| 72 67 28 61 72 67 73 29 | 3b 0d 20 20 20 20 53 65 |rg(args)|;. Se|
|00000aa0| 74 50 6f 72 74 28 67 77 | 69 6e 64 6f 77 29 3b 0d |tPort(gw|indow);.|
|00000ab0| 20 20 20 20 45 72 61 73 | 65 52 65 63 74 28 26 67 | Eras|eRect(&g|
|00000ac0| 77 69 6e 64 6f 77 2d 3e | 70 6f 72 74 52 65 63 74 |window->|portRect|
|00000ad0| 29 3b 0d 20 20 20 20 53 | 65 74 50 6f 72 74 28 63 |);. S|etPort(c|
|00000ae0| 77 69 6e 64 6f 77 29 3b | 0d 20 20 20 20 72 65 74 |window);|. ret|
|00000af0| 75 72 6e 20 28 4e 49 4c | 29 3b 0d 7d 0d 0d 2f 2a |urn (NIL|);.}../*|
|00000b00| 20 64 6f 5f 30 20 2d 20 | 48 61 6e 64 6c 65 20 63 | do_0 - |Handle c|
|00000b10| 6f 6d 6d 61 6e 64 73 20 | 74 68 61 74 20 72 65 71 |ommands |that req|
|00000b20| 75 69 72 65 20 6e 6f 20 | 61 72 67 75 6d 65 6e 74 |uire no |argument|
|00000b30| 73 20 2a 2f 0d 4c 4f 43 | 41 4c 20 4e 4f 44 45 20 |s */.LOC|AL NODE |
|00000b40| 2a 64 6f 5f 30 28 61 72 | 67 73 2c 66 63 6e 29 0d |*do_0(ar|gs,fcn).|
|00000b50| 20 20 4e 4f 44 45 20 2a | 61 72 67 73 3b 20 69 6e | NODE *|args; in|
|00000b60| 74 20 66 63 6e 3b 0d 7b | 0d 20 20 20 20 78 6c 6c |t fcn;.{|. xll|
|00000b70| 61 73 74 61 72 67 28 61 | 72 67 73 29 3b 0d 20 20 |astarg(a|rgs);. |
|00000b80| 20 20 53 65 74 50 6f 72 | 74 28 67 77 69 6e 64 6f | SetPor|t(gwindo|
|00000b90| 77 29 3b 0d 20 20 20 20 | 73 77 69 74 63 68 20 28 |w);. |switch (|
|00000ba0| 66 63 6e 29 20 7b 0d 20 | 20 20 20 63 61 73 65 20 |fcn) {. | case |
|00000bb0| 27 48 27 3a 09 48 69 64 | 65 50 65 6e 28 29 3b 20 |'H':.Hid|ePen(); |
|00000bc0| 62 72 65 61 6b 3b 0d 20 | 20 20 20 63 61 73 65 20 |break;. | case |
|00000bd0| 27 53 27 3a 09 53 68 6f | 77 50 65 6e 28 29 3b 20 |'S':.Sho|wPen(); |
|00000be0| 62 72 65 61 6b 3b 0d 20 | 20 20 20 7d 0d 20 20 20 |break;. | }. |
|00000bf0| 20 53 65 74 50 6f 72 74 | 28 63 77 69 6e 64 6f 77 | SetPort|(cwindow|
|00000c00| 29 3b 0d 20 20 20 20 72 | 65 74 75 72 6e 20 28 4e |);. r|eturn (N|
|00000c10| 49 4c 29 3b 0d 7d 0d 0d | 2f 2a 20 64 6f 5f 31 20 |IL);.}..|/* do_1 |
|00000c20| 2d 20 48 61 6e 64 6c 65 | 20 63 6f 6d 6d 61 6e 64 |- Handle| command|
|00000c30| 73 20 74 68 61 74 20 72 | 65 71 75 69 72 65 20 6f |s that r|equire o|
|00000c40| 6e 65 20 69 6e 74 65 67 | 65 72 20 61 72 67 75 6d |ne integ|er argum|
|00000c50| 65 6e 74 20 2a 2f 0d 4c | 4f 43 41 4c 20 4e 4f 44 |ent */.L|OCAL NOD|
|00000c60| 45 20 2a 64 6f 5f 31 28 | 61 72 67 73 2c 66 63 6e |E *do_1(|args,fcn|
|00000c70| 29 0d 20 20 4e 4f 44 45 | 20 2a 61 72 67 73 3b 20 |). NODE| *args; |
|00000c80| 69 6e 74 20 66 63 6e 3b | 0d 7b 0d 20 20 20 20 69 |int fcn;|.{. i|
|00000c90| 6e 74 20 78 3b 0d 20 20 | 20 20 78 20 3d 20 67 65 |nt x;. | x = ge|
|00000ca0| 74 6e 75 6d 62 65 72 28 | 26 61 72 67 73 29 3b 0d |tnumber(|&args);.|
|00000cb0| 20 20 20 20 78 6c 6c 61 | 73 74 61 72 67 28 61 72 | xlla|starg(ar|
|00000cc0| 67 73 29 3b 0d 20 20 20 | 20 53 65 74 50 6f 72 74 |gs);. | SetPort|
|00000cd0| 28 67 77 69 6e 64 6f 77 | 29 3b 0d 20 20 20 20 73 |(gwindow|);. s|
|00000ce0| 77 69 74 63 68 20 28 66 | 63 6e 29 20 7b 0d 20 20 |witch (f|cn) {. |
|00000cf0| 20 20 63 61 73 65 20 27 | 4d 27 3a 09 50 65 6e 4d | case '|M':.PenM|
|00000d00| 6f 64 65 28 78 29 3b 20 | 62 72 65 61 6b 3b 0d 20 |ode(x); |break;. |
|00000d10| 20 20 20 7d 0d 20 20 20 | 20 53 65 74 50 6f 72 74 | }. | SetPort|
|00000d20| 28 63 77 69 6e 64 6f 77 | 29 3b 0d 20 20 20 20 72 |(cwindow|);. r|
|00000d30| 65 74 75 72 6e 20 28 4e | 49 4c 29 3b 0d 7d 0d 0d |eturn (N|IL);.}..|
|00000d40| 2f 2a 20 64 6f 5f 32 20 | 2d 20 48 61 6e 64 6c 65 |/* do_2 |- Handle|
|00000d50| 20 63 6f 6d 6d 61 6e 64 | 73 20 74 68 61 74 20 72 | command|s that r|
|00000d60| 65 71 75 69 72 65 20 74 | 77 6f 20 69 6e 74 65 67 |equire t|wo integ|
|00000d70| 65 72 20 61 72 67 75 6d | 65 6e 74 73 20 2a 2f 0d |er argum|ents */.|
|00000d80| 4c 4f 43 41 4c 20 4e 4f | 44 45 20 2a 64 6f 5f 32 |LOCAL NO|DE *do_2|
|00000d90| 28 61 72 67 73 2c 66 63 | 6e 29 0d 20 20 4e 4f 44 |(args,fc|n). NOD|
|00000da0| 45 20 2a 61 72 67 73 3b | 20 69 6e 74 20 66 63 6e |E *args;| int fcn|
|00000db0| 3b 0d 7b 0d 20 20 20 20 | 69 6e 74 20 68 2c 76 3b |;.{. |int h,v;|
|00000dc0| 0d 20 20 20 20 68 20 3d | 20 67 65 74 6e 75 6d 62 |. h =| getnumb|
|00000dd0| 65 72 28 26 61 72 67 73 | 29 3b 0d 20 20 20 20 76 |er(&args|);. v|
|00000de0| 20 3d 20 67 65 74 6e 75 | 6d 62 65 72 28 26 61 72 | = getnu|mber(&ar|
|00000df0| 67 73 29 3b 0d 20 20 20 | 20 78 6c 6c 61 73 74 61 |gs);. | xllasta|
|00000e00| 72 67 28 61 72 67 73 29 | 3b 0d 20 20 20 20 53 65 |rg(args)|;. Se|
|00000e10| 74 50 6f 72 74 28 67 77 | 69 6e 64 6f 77 29 3b 0d |tPort(gw|indow);.|
|00000e20| 20 20 20 20 73 77 69 74 | 63 68 20 28 66 63 6e 29 | swit|ch (fcn)|
|00000e30| 20 7b 0d 20 20 20 20 63 | 61 73 65 20 27 6c 27 3a | {. c|ase 'l':|
|00000e40| 09 4c 69 6e 65 54 6f 28 | 68 2c 76 29 3b 20 62 72 |.LineTo(|h,v); br|
|00000e50| 65 61 6b 3b 0d 20 20 20 | 20 63 61 73 65 20 27 4c |eak;. | case 'L|
|00000e60| 27 3a 09 4c 69 6e 65 28 | 68 2c 76 29 3b 20 20 20 |':.Line(|h,v); |
|00000e70| 62 72 65 61 6b 3b 0d 20 | 20 20 20 63 61 73 65 20 |break;. | case |
|00000e80| 27 6d 27 3a 20 20 20 4d | 6f 76 65 54 6f 28 68 2c |'m': M|oveTo(h,|
|00000e90| 76 29 3b 20 62 72 65 61 | 6b 3b 0d 20 20 20 20 63 |v); brea|k;. c|
|00000ea0| 61 73 65 20 27 4d 27 3a | 09 4d 6f 76 65 28 68 2c |ase 'M':|.Move(h,|
|00000eb0| 76 29 3b 20 20 20 62 72 | 65 61 6b 3b 0d 20 20 20 |v); br|eak;. |
|00000ec0| 20 63 61 73 65 20 27 53 | 27 3a 09 50 65 6e 53 69 | case 'S|':.PenSi|
|00000ed0| 7a 65 28 68 2c 76 29 3b | 62 72 65 61 6b 3b 0d 20 |ze(h,v);|break;. |
|00000ee0| 20 20 20 7d 0d 20 20 20 | 20 53 65 74 50 6f 72 74 | }. | SetPort|
|00000ef0| 28 63 77 69 6e 64 6f 77 | 29 3b 0d 20 20 20 20 72 |(cwindow|);. r|
|00000f00| 65 74 75 72 6e 20 28 4e | 49 4c 29 3b 0d 7d 0d 0d |eturn (N|IL);.}..|
|00000f10| 2f 2a 20 67 65 74 6e 75 | 6d 62 65 72 20 2d 20 67 |/* getnu|mber - g|
|00000f20| 65 74 20 61 6e 20 69 6e | 74 65 67 65 72 20 70 61 |et an in|teger pa|
|00000f30| 72 61 6d 65 74 65 72 20 | 2a 2f 0d 4c 4f 43 41 4c |rameter |*/.LOCAL|
|00000f40| 20 69 6e 74 20 67 65 74 | 6e 75 6d 62 65 72 28 70 | int get|number(p|
|00000f50| 61 72 67 73 29 0d 20 20 | 4e 4f 44 45 20 2a 2a 70 |args). |NODE **p|
|00000f60| 61 72 67 73 3b 0d 7b 0d | 20 20 20 20 72 65 74 75 |args;.{.| retu|
|00000f70| 72 6e 20 28 28 69 6e 74 | 29 78 6c 6d 61 74 63 68 |rn ((int|)xlmatch|
|00000f80| 28 49 4e 54 2c 70 61 72 | 67 73 29 2d 3e 6e 5f 69 |(INT,par|gs)->n_i|
|00000f90| 6e 74 29 3b 0d 7d 0d 0d | 2f 2a 20 78 74 6f 6f 6c |nt);.}..|/* xtool|
|00000fa0| 20 2d 20 63 61 6c 6c 20 | 74 68 65 20 74 6f 6f 6c | - call |the tool|
|00000fb0| 62 6f 78 20 2a 2f 0d 4e | 4f 44 45 20 2a 78 74 6f |box */.N|ODE *xto|
|00000fc0| 6f 6c 28 61 72 67 73 29 | 0d 20 20 4e 4f 44 45 20 |ol(args)|. NODE |
|00000fd0| 2a 61 72 67 73 3b 0d 7b | 0d 20 20 20 20 4e 4f 44 |*args;.{|. NOD|
|00000fe0| 45 20 2a 76 61 6c 3b 0d | 20 20 20 20 69 6e 74 20 |E *val;.| int |
|00000ff0| 74 72 61 70 3b 0d 0d 20 | 20 20 20 74 72 61 70 20 |trap;.. | trap |
|00001000| 3d 20 28 69 6e 74 29 78 | 6c 6d 61 74 63 68 28 49 |= (int)x|lmatch(I|
|00001010| 4e 54 2c 26 61 72 67 73 | 29 2d 3e 6e 5f 69 6e 74 |NT,&args|)->n_int|
|00001020| 3b 0d 0d 20 20 20 20 61 | 73 6d 20 7b 0d 09 6d 6f |;.. a|sm {..mo|
|00001030| 76 65 2e 6c 09 61 72 67 | 73 28 41 36 29 2c 44 30 |ve.l.arg|s(A6),D0|
|00001040| 0d 09 62 65 71 09 4c 32 | 0d 4c 31 3a 09 6d 6f 76 |..beq.L2|.L1:.mov|
|00001050| 65 2e 6c 09 44 30 2c 41 | 30 0d 09 6d 6f 76 65 2e |e.l.D0,A|0..move.|
|00001060| 6c 09 32 28 41 30 29 2c | 41 31 0d 09 6d 6f 76 65 |l.2(A0),|A1..move|
|00001070| 2e 77 09 34 28 41 31 29 | 2c 2d 28 41 37 29 0d 09 |.w.4(A1)|,-(A7)..|
|00001080| 6d 6f 76 65 2e 6c 09 36 | 28 41 30 29 2c 44 30 0d |move.l.6|(A0),D0.|
|00001090| 09 62 6e 65 09 4c 31 0d | 4c 32 3a 09 6c 65 61 09 |.bne.L1.|L2:.lea.|
|000010a0| 4c 33 2c 41 30 0d 09 6d | 6f 76 65 2e 77 09 74 72 |L3,A0..m|ove.w.tr|
|000010b0| 61 70 28 41 36 29 2c 28 | 41 30 29 0d 4c 33 3a 09 |ap(A6),(|A0).L3:.|
|000010c0| 64 63 2e 77 09 30 78 41 | 30 30 30 0d 09 63 6c 72 |dc.w.0xA|000..clr|
|000010d0| 2e 6c 09 76 61 6c 28 41 | 36 29 0d 20 20 20 20 7d |.l.val(A|6). }|
|000010e0| 0d 0d 20 20 20 20 72 65 | 74 75 72 6e 20 28 76 61 |.. re|turn (va|
|000010f0| 6c 29 3b 0d 7d 0d 0d 2f | 2a 20 78 74 6f 6f 6c 31 |l);.}../|* xtool1|
|00001100| 36 20 2d 20 63 61 6c 6c | 20 74 68 65 20 74 6f 6f |6 - call| the too|
|00001110| 6c 62 6f 78 20 77 69 74 | 68 20 61 20 31 36 20 62 |lbox wit|h a 16 b|
|00001120| 69 74 20 72 65 73 75 6c | 74 20 2a 2f 0d 4e 4f 44 |it resul|t */.NOD|
|00001130| 45 20 2a 78 74 6f 6f 6c | 31 36 28 61 72 67 73 29 |E *xtool|16(args)|
|00001140| 0d 20 20 4e 4f 44 45 20 | 2a 61 72 67 73 3b 0d 7b |. NODE |*args;.{|
|00001150| 0d 20 20 20 20 69 6e 74 | 20 74 72 61 70 2c 76 61 |. int| trap,va|
|00001160| 6c 3b 0d 0d 20 20 20 20 | 74 72 61 70 20 3d 20 78 |l;.. |trap = x|
|00001170| 6c 6d 61 74 63 68 28 49 | 4e 54 2c 26 61 72 67 73 |lmatch(I|NT,&args|
|00001180| 29 2d 3e 6e 5f 69 6e 74 | 3b 0d 0d 20 20 20 20 61 |)->n_int|;.. a|
|00001190| 73 6d 20 7b 0d 09 63 6c | 72 2e 77 09 2d 28 41 37 |sm {..cl|r.w.-(A7|
|000011a0| 29 0d 09 6d 6f 76 65 2e | 6c 09 61 72 67 73 28 41 |)..move.|l.args(A|
|000011b0| 36 29 2c 44 30 0d 09 62 | 65 71 09 4c 32 0d 4c 31 |6),D0..b|eq.L2.L1|
|000011c0| 3a 09 6d 6f 76 65 2e 6c | 09 44 30 2c 41 30 0d 09 |:.move.l|.D0,A0..|
|000011d0| 6d 6f 76 65 2e 6c 09 32 | 28 41 30 29 2c 41 31 0d |move.l.2|(A0),A1.|
|000011e0| 09 6d 6f 76 65 2e 77 09 | 34 28 41 31 29 2c 2d 28 |.move.w.|4(A1),-(|
|000011f0| 41 37 29 0d 09 6d 6f 76 | 65 2e 6c 09 36 28 41 30 |A7)..mov|e.l.6(A0|
|00001200| 29 2c 44 30 0d 09 62 6e | 65 09 4c 31 0d 4c 32 3a |),D0..bn|e.L1.L2:|
|00001210| 09 6c 65 61 09 4c 33 2c | 41 30 0d 09 6d 6f 76 65 |.lea.L3,|A0..move|
|00001220| 2e 77 09 74 72 61 70 28 | 41 36 29 2c 28 41 30 29 |.w.trap(|A6),(A0)|
|00001230| 0d 4c 33 3a 09 64 63 2e | 77 09 30 78 41 30 30 30 |.L3:.dc.|w.0xA000|
|00001240| 0d 09 6d 6f 76 65 2e 77 | 09 28 41 37 29 2b 2c 76 |..move.w|.(A7)+,v|
|00001250| 61 6c 28 41 36 29 0d 20 | 20 20 20 7d 0d 0d 20 20 |al(A6). | }.. |
|00001260| 20 20 72 65 74 75 72 6e | 20 28 63 76 66 69 78 6e | return| (cvfixn|
|00001270| 75 6d 28 28 46 49 58 4e | 55 4d 29 76 61 6c 29 29 |um((FIXN|UM)val))|
|00001280| 3b 0d 7d 0d 0d 2f 2a 20 | 78 74 6f 6f 6c 33 32 20 |;.}../* |xtool32 |
|00001290| 2d 20 63 61 6c 6c 20 74 | 68 65 20 74 6f 6f 6c 62 |- call t|he toolb|
|000012a0| 6f 78 20 77 69 74 68 20 | 61 20 33 32 20 62 69 74 |ox with |a 32 bit|
|000012b0| 20 72 65 73 75 6c 74 20 | 2a 2f 0d 4e 4f 44 45 20 | result |*/.NODE |
|000012c0| 2a 78 74 6f 6f 6c 33 32 | 28 61 72 67 73 29 0d 20 |*xtool32|(args). |
|000012d0| 20 4e 4f 44 45 20 2a 61 | 72 67 73 3b 0d 7b 0d 20 | NODE *a|rgs;.{. |
|000012e0| 20 20 20 69 6e 74 20 74 | 72 61 70 3b 0d 20 20 20 | int t|rap;. |
|000012f0| 20 6c 6f 6e 67 20 76 61 | 6c 3b 0d 0d 20 20 20 20 | long va|l;.. |
|00001300| 74 72 61 70 20 3d 20 78 | 6c 6d 61 74 63 68 28 49 |trap = x|lmatch(I|
|00001310| 4e 54 2c 26 61 72 67 73 | 29 2d 3e 6e 5f 69 6e 74 |NT,&args|)->n_int|
|00001320| 3b 0d 0d 20 20 20 20 61 | 73 6d 20 7b 0d 09 63 6c |;.. a|sm {..cl|
|00001330| 72 2e 6c 09 2d 28 41 37 | 29 0d 09 6d 6f 76 65 2e |r.l.-(A7|)..move.|
|00001340| 6c 09 61 72 67 73 28 41 | 36 29 2c 44 30 0d 09 62 |l.args(A|6),D0..b|
|00001350| 65 71 09 4c 32 0d 4c 31 | 3a 09 6d 6f 76 65 2e 6c |eq.L2.L1|:.move.l|
|00001360| 09 44 30 2c 41 30 0d 09 | 6d 6f 76 65 2e 6c 09 32 |.D0,A0..|move.l.2|
|00001370| 28 41 30 29 2c 41 31 0d | 09 6d 6f 76 65 2e 77 09 |(A0),A1.|.move.w.|
|00001380| 34 28 41 31 29 2c 2d 28 | 41 37 29 0d 09 6d 6f 76 |4(A1),-(|A7)..mov|
|00001390| 65 2e 6c 09 36 28 41 30 | 29 2c 44 30 0d 09 62 6e |e.l.6(A0|),D0..bn|
|000013a0| 65 09 4c 31 0d 4c 32 3a | 09 6c 65 61 09 4c 33 2c |e.L1.L2:|.lea.L3,|
|000013b0| 41 30 0d 09 6d 6f 76 65 | 2e 77 09 74 72 61 70 28 |A0..move|.w.trap(|
|000013c0| 41 36 29 2c 28 41 30 29 | 0d 4c 33 3a 09 64 63 2e |A6),(A0)|.L3:.dc.|
|000013d0| 77 09 30 78 41 30 30 30 | 0d 09 6d 6f 76 65 2e 6c |w.0xA000|..move.l|
|000013e0| 09 28 41 37 29 2b 2c 76 | 61 6c 28 41 36 29 0d 20 |.(A7)+,v|al(A6). |
|000013f0| 20 20 20 7d 0d 0d 20 20 | 20 20 72 65 74 75 72 6e | }.. | return|
|00001400| 20 28 63 76 66 69 78 6e | 75 6d 28 28 46 49 58 4e | (cvfixn|um((FIXN|
|00001410| 55 4d 29 76 61 6c 29 29 | 3b 0d 7d 0d 0d 2f 2a 20 |UM)val))|;.}../* |
|00001420| 78 6e 65 77 68 61 6e 64 | 6c 65 20 2d 20 61 6c 6c |xnewhand|le - all|
|00001430| 6f 63 61 74 65 20 61 20 | 6e 65 77 20 68 61 6e 64 |ocate a |new hand|
|00001440| 6c 65 20 2a 2f 0d 4e 4f | 44 45 20 2a 78 6e 65 77 |le */.NO|DE *xnew|
|00001450| 68 61 6e 64 6c 65 28 61 | 72 67 73 29 0d 20 20 4e |handle(a|rgs). N|
|00001460| 4f 44 45 20 2a 61 72 67 | 73 3b 0d 7b 0d 20 20 20 |ODE *arg|s;.{. |
|00001470| 20 6c 6f 6e 67 20 73 69 | 7a 65 3b 0d 20 20 20 20 | long si|ze;. |
|00001480| 73 69 7a 65 20 3d 20 28 | 6c 6f 6e 67 29 78 6c 6d |size = (|long)xlm|
|00001490| 61 74 63 68 28 49 4e 54 | 2c 26 61 72 67 73 29 2d |atch(INT|,&args)-|
|000014a0| 3e 6e 5f 69 6e 74 3b 0d | 20 20 20 20 78 6c 6c 61 |>n_int;.| xlla|
|000014b0| 73 74 61 72 67 28 61 72 | 67 73 29 3b 0d 20 20 20 |starg(ar|gs);. |
|000014c0| 20 72 65 74 75 72 6e 20 | 28 63 76 66 69 78 6e 75 | return |(cvfixnu|
|000014d0| 6d 28 28 46 49 58 4e 55 | 4d 29 4e 65 77 48 61 6e |m((FIXNU|M)NewHan|
|000014e0| 64 6c 65 28 73 69 7a 65 | 29 29 29 3b 0d 7d 0d 0d |dle(size|)));.}..|
|000014f0| 2f 2a 20 78 6e 65 77 70 | 74 72 20 2d 20 61 6c 6c |/* xnewp|tr - all|
|00001500| 6f 63 61 74 65 20 6d 65 | 6d 6f 72 79 20 2a 2f 0d |ocate me|mory */.|
|00001510| 4e 4f 44 45 20 2a 78 6e | 65 77 70 74 72 28 61 72 |NODE *xn|ewptr(ar|
|00001520| 67 73 29 0d 20 20 4e 4f | 44 45 20 2a 61 72 67 73 |gs). NO|DE *args|
|00001530| 3b 0d 7b 0d 20 20 20 20 | 6c 6f 6e 67 20 73 69 7a |;.{. |long siz|
|00001540| 65 3b 0d 20 20 20 20 73 | 69 7a 65 20 3d 20 28 6c |e;. s|ize = (l|
|00001550| 6f 6e 67 29 78 6c 6d 61 | 74 63 68 28 49 4e 54 2c |ong)xlma|tch(INT,|
|00001560| 26 61 72 67 73 29 2d 3e | 6e 5f 69 6e 74 3b 0d 20 |&args)->|n_int;. |
|00001570| 20 20 20 78 6c 6c 61 73 | 74 61 72 67 28 61 72 67 | xllas|targ(arg|
|00001580| 73 29 3b 0d 20 20 20 20 | 72 65 74 75 72 6e 20 28 |s);. |return (|
|00001590| 63 76 66 69 78 6e 75 6d | 28 28 46 49 58 4e 55 4d |cvfixnum|((FIXNUM|
|000015a0| 29 4e 65 77 50 74 72 28 | 73 69 7a 65 29 29 29 3b |)NewPtr(|size)));|
|000015b0| 0d 7d 0d 20 20 20 20 0d | 2f 2a 20 78 68 69 77 6f |.}. .|/* xhiwo|
|000015c0| 72 64 20 2d 20 72 65 74 | 75 72 6e 20 74 68 65 20 |rd - ret|urn the |
|000015d0| 68 69 67 68 20 6f 72 64 | 65 72 20 31 36 20 62 69 |high ord|er 16 bi|
|000015e0| 74 73 20 6f 66 20 61 6e | 20 69 6e 74 65 67 65 72 |ts of an| integer|
|000015f0| 20 2a 2f 0d 4e 4f 44 45 | 20 2a 78 68 69 77 6f 72 | */.NODE| *xhiwor|
|00001600| 64 28 61 72 67 73 29 0d | 20 20 4e 4f 44 45 20 2a |d(args).| NODE *|
|00001610| 61 72 67 73 3b 0d 7b 0d | 20 20 20 20 75 6e 73 69 |args;.{.| unsi|
|00001620| 67 6e 65 64 20 69 6e 74 | 20 76 61 6c 3b 0d 20 20 |gned int| val;. |
|00001630| 20 20 76 61 6c 20 3d 20 | 28 75 6e 73 69 67 6e 65 | val = |(unsigne|
|00001640| 64 20 69 6e 74 29 28 78 | 6c 6d 61 74 63 68 28 49 |d int)(x|lmatch(I|
|00001650| 4e 54 2c 26 61 72 67 73 | 29 2d 3e 6e 5f 69 6e 74 |NT,&args|)->n_int|
|00001660| 20 3e 3e 20 31 36 29 3b | 0d 20 20 20 20 78 6c 6c | >> 16);|. xll|
|00001670| 61 73 74 61 72 67 28 61 | 72 67 73 29 3b 0d 20 20 |astarg(a|rgs);. |
|00001680| 20 20 72 65 74 75 72 6e | 20 28 63 76 66 69 78 6e | return| (cvfixn|
|00001690| 75 6d 28 28 46 49 58 4e | 55 4d 29 76 61 6c 29 29 |um((FIXN|UM)val))|
|000016a0| 3b 0d 7d 0d 0d 2f 2a 20 | 78 6c 6f 77 6f 72 64 20 |;.}../* |xloword |
|000016b0| 2d 20 72 65 74 75 72 6e | 20 74 68 65 20 6c 6f 77 |- return| the low|
|000016c0| 20 6f 72 64 65 72 20 31 | 36 20 62 69 74 73 20 6f | order 1|6 bits o|
|000016d0| 66 20 61 6e 20 69 6e 74 | 65 67 65 72 20 2a 2f 0d |f an int|eger */.|
|000016e0| 4e 4f 44 45 20 2a 78 6c | 6f 77 6f 72 64 28 61 72 |NODE *xl|oword(ar|
|000016f0| 67 73 29 0d 20 20 4e 4f | 44 45 20 2a 61 72 67 73 |gs). NO|DE *args|
|00001700| 3b 0d 7b 0d 20 20 20 20 | 75 6e 73 69 67 6e 65 64 |;.{. |unsigned|
|00001710| 20 69 6e 74 20 76 61 6c | 3b 0d 20 20 20 20 76 61 | int val|;. va|
|00001720| 6c 20 3d 20 28 75 6e 73 | 69 67 6e 65 64 20 69 6e |l = (uns|igned in|
|00001730| 74 29 78 6c 6d 61 74 63 | 68 28 49 4e 54 2c 26 61 |t)xlmatc|h(INT,&a|
|00001740| 72 67 73 29 2d 3e 6e 5f | 69 6e 74 3b 0d 20 20 20 |rgs)->n_|int;. |
|00001750| 20 78 6c 6c 61 73 74 61 | 72 67 28 61 72 67 73 29 | xllasta|rg(args)|
|00001760| 3b 0d 20 20 20 20 72 65 | 74 75 72 6e 20 28 63 76 |;. re|turn (cv|
|00001770| 66 69 78 6e 75 6d 28 28 | 46 49 58 4e 55 4d 29 76 |fixnum((|FIXNUM)v|
|00001780| 61 6c 29 29 3b 0d 7d 0d | 0d 2f 2a 20 78 72 64 6e |al));.}.|./* xrdn|
|00001790| 6f 68 61 6e 67 20 2d 20 | 67 65 74 20 74 68 65 20 |ohang - |get the |
|000017a0| 6e 65 78 74 20 63 68 61 | 72 61 63 74 65 72 20 69 |next cha|racter i|
|000017b0| 6e 20 74 68 65 20 6c 6f | 6f 6b 2d 61 68 65 61 64 |n the lo|ok-ahead|
|000017c0| 20 62 75 66 66 65 72 20 | 2a 2f 0d 4e 4f 44 45 20 | buffer |*/.NODE |
|000017d0| 2a 78 72 64 6e 6f 68 61 | 6e 67 28 61 72 67 73 29 |*xrdnoha|ng(args)|
|000017e0| 0d 20 20 4e 4f 44 45 20 | 2a 61 72 67 73 3b 0d 7b |. NODE |*args;.{|
|000017f0| 0d 20 20 20 20 69 6e 74 | 20 63 68 3b 0d 20 20 20 |. int| ch;. |
|00001800| 20 78 6c 6c 61 73 74 61 | 72 67 28 61 72 67 73 29 | xllasta|rg(args)|
|00001810| 3b 0d 20 20 20 20 69 66 | 20 28 28 63 68 20 3d 20 |;. if| ((ch = |
|00001820| 73 63 72 6e 65 78 74 63 | 28 29 29 20 3d 3d 20 45 |scrnextc|()) == E|
|00001830| 4f 46 29 0d 09 72 65 74 | 75 72 6e 20 28 4e 49 4c |OF)..ret|urn (NIL|
|00001840| 29 3b 0d 20 20 20 20 72 | 65 74 75 72 6e 20 28 63 |);. r|eturn (c|
|00001850| 76 66 69 78 6e 75 6d 28 | 28 46 49 58 4e 55 4d 29 |vfixnum(|(FIXNUM)|
|00001860| 63 68 29 29 3b 0d 7d 0d | 0d 2f 2a 20 6f 73 66 69 |ch));.}.|./* osfi|
|00001870| 6e 69 74 20 2d 20 69 6e | 69 74 69 61 6c 69 7a 65 |nit - in|itialize|
|00001880| 20 74 68 65 20 6d 61 63 | 69 6e 74 6f 73 68 20 66 | the mac|intosh f|
|00001890| 75 6e 63 74 69 6f 6e 73 | 20 2a 2f 0d 6f 73 66 69 |unctions| */.osfi|
|000018a0| 6e 69 74 28 29 0d 7b 0d | 20 20 20 20 4e 4f 44 45 |nit().{.| NODE|
|000018b0| 20 2a 73 79 6d 3b 0d 0d | 20 20 20 20 78 6c 73 75 | *sym;..| xlsu|
|000018c0| 62 72 28 22 48 49 44 45 | 50 45 4e 22 2c 09 09 53 |br("HIDE|PEN",..S|
|000018d0| 55 42 52 2c 09 78 68 69 | 64 65 70 65 6e 29 3b 0d |UBR,.xhi|depen);.|
|000018e0| 20 20 20 20 78 6c 73 75 | 62 72 28 22 53 48 4f 57 | xlsu|br("SHOW|
|000018f0| 50 45 4e 22 2c 09 09 53 | 55 42 52 2c 09 78 73 68 |PEN",..S|UBR,.xsh|
|00001900| 6f 77 70 65 6e 29 3b 0d | 20 20 20 20 78 6c 73 75 |owpen);.| xlsu|
|00001910| 62 72 28 22 47 45 54 50 | 45 4e 22 2c 09 09 53 55 |br("GETP|EN",..SU|
|00001920| 42 52 2c 09 78 67 65 74 | 70 65 6e 29 3b 0d 20 20 |BR,.xget|pen);. |
|00001930| 20 20 78 6c 73 75 62 72 | 28 22 50 45 4e 53 49 5a | xlsubr|("PENSIZ|
|00001940| 45 22 2c 09 09 53 55 42 | 52 2c 09 78 70 65 6e 73 |E",..SUB|R,.xpens|
|00001950| 69 7a 65 29 3b 0d 20 20 | 20 20 78 6c 73 75 62 72 |ize);. | xlsubr|
|00001960| 28 22 50 45 4e 4d 4f 44 | 45 22 2c 09 09 53 55 42 |("PENMOD|E",..SUB|
|00001970| 52 2c 09 78 70 65 6e 6d | 6f 64 65 29 3b 0d 20 20 |R,.xpenm|ode);. |
|00001980| 20 20 78 6c 73 75 62 72 | 28 22 50 45 4e 50 41 54 | xlsubr|("PENPAT|
|00001990| 22 2c 09 09 53 55 42 52 | 2c 09 78 70 65 6e 70 61 |",..SUBR|,.xpenpa|
|000019a0| 74 29 3b 0d 20 20 20 20 | 78 6c 73 75 62 72 28 22 |t);. |xlsubr("|
|000019b0| 50 45 4e 4e 4f 52 4d 41 | 4c 22 2c 09 09 53 55 42 |PENNORMA|L",..SUB|
|000019c0| 52 2c 09 78 70 65 6e 6e | 6f 72 6d 61 6c 29 3b 0d |R,.xpenn|ormal);.|
|000019d0| 20 20 20 20 78 6c 73 75 | 62 72 28 22 4d 4f 56 45 | xlsu|br("MOVE|
|000019e0| 54 4f 22 2c 09 09 53 55 | 42 52 2c 09 78 6d 6f 76 |TO",..SU|BR,.xmov|
|000019f0| 65 74 6f 29 3b 0d 20 20 | 20 20 78 6c 73 75 62 72 |eto);. | xlsubr|
|00001a00| 28 22 4d 4f 56 45 22 2c | 09 09 53 55 42 52 2c 09 |("MOVE",|..SUBR,.|
|00001a10| 78 6d 6f 76 65 29 3b 0d | 20 20 20 20 78 6c 73 75 |xmove);.| xlsu|
|00001a20| 62 72 28 22 4c 49 4e 45 | 54 4f 22 2c 09 09 53 55 |br("LINE|TO",..SU|
|00001a30| 42 52 2c 09 78 6c 69 6e | 65 74 6f 29 3b 0d 20 20 |BR,.xlin|eto);. |
|00001a40| 20 20 78 6c 73 75 62 72 | 28 22 4c 49 4e 45 22 2c | xlsubr|("LINE",|
|00001a50| 09 09 53 55 42 52 2c 09 | 78 6c 69 6e 65 29 3b 0d |..SUBR,.|xline);.|
|00001a60| 20 20 20 20 78 6c 73 75 | 62 72 28 22 53 48 4f 57 | xlsu|br("SHOW|
|00001a70| 2d 47 52 41 50 48 49 43 | 53 22 2c 09 53 55 42 52 |-GRAPHIC|S",.SUBR|
|00001a80| 2c 09 78 73 68 6f 77 67 | 72 61 70 68 69 63 73 29 |,.xshowg|raphics)|
|00001a90| 3b 0d 20 20 20 20 78 6c | 73 75 62 72 28 22 48 49 |;. xl|subr("HI|
|00001aa0| 44 45 2d 47 52 41 50 48 | 49 43 53 22 2c 09 53 55 |DE-GRAPH|ICS",.SU|
|00001ab0| 42 52 2c 09 78 68 69 64 | 65 67 72 61 70 68 69 63 |BR,.xhid|egraphic|
|00001ac0| 73 29 3b 0d 20 20 20 20 | 78 6c 73 75 62 72 28 22 |s);. |xlsubr("|
|00001ad0| 43 4c 45 41 52 2d 47 52 | 41 50 48 49 43 53 22 2c |CLEAR-GR|APHICS",|
|00001ae0| 09 53 55 42 52 2c 09 78 | 63 6c 65 61 72 67 72 61 |.SUBR,.x|cleargra|
|00001af0| 70 68 69 63 73 29 3b 0d | 20 20 20 20 78 6c 73 75 |phics);.| xlsu|
|00001b00| 62 72 28 22 54 4f 4f 4c | 42 4f 58 22 2c 09 09 53 |br("TOOL|BOX",..S|
|00001b10| 55 42 52 2c 09 78 74 6f | 6f 6c 29 3b 0d 20 20 20 |UBR,.xto|ol);. |
|00001b20| 20 78 6c 73 75 62 72 28 | 22 54 4f 4f 4c 42 4f 58 | xlsubr(|"TOOLBOX|
|00001b30| 2d 31 36 22 2c 09 53 55 | 42 52 2c 09 78 74 6f 6f |-16",.SU|BR,.xtoo|
|00001b40| 6c 31 36 29 3b 0d 20 20 | 20 20 78 6c 73 75 62 72 |l16);. | xlsubr|
|00001b50| 28 22 54 4f 4f 4c 42 4f | 58 2d 33 32 22 2c 09 53 |("TOOLBO|X-32",.S|
|00001b60| 55 42 52 2c 09 78 74 6f | 6f 6c 33 32 29 3b 0d 20 |UBR,.xto|ol32);. |
|00001b70| 20 20 20 78 6c 73 75 62 | 72 28 22 4e 45 57 48 41 | xlsub|r("NEWHA|
|00001b80| 4e 44 4c 45 22 2c 09 09 | 53 55 42 52 2c 09 78 6e |NDLE",..|SUBR,.xn|
|00001b90| 65 77 68 61 6e 64 6c 65 | 29 3b 0d 20 20 20 20 78 |ewhandle|);. x|
|00001ba0| 6c 73 75 62 72 28 22 4e | 45 57 50 54 52 22 2c 09 |lsubr("N|EWPTR",.|
|00001bb0| 09 53 55 42 52 2c 09 78 | 6e 65 77 70 74 72 29 3b |.SUBR,.x|newptr);|
|00001bc0| 0d 20 20 20 20 78 6c 73 | 75 62 72 28 22 48 49 57 |. xls|ubr("HIW|
|00001bd0| 4f 52 44 22 2c 09 09 53 | 55 42 52 2c 09 78 68 69 |ORD",..S|UBR,.xhi|
|00001be0| 77 6f 72 64 29 3b 0d 20 | 20 20 20 78 6c 73 75 62 |word);. | xlsub|
|00001bf0| 72 28 22 4c 4f 57 4f 52 | 44 22 2c 09 09 53 55 42 |r("LOWOR|D",..SUB|
|00001c00| 52 2c 09 78 6c 6f 77 6f | 72 64 29 3b 0d 20 20 20 |R,.xlowo|rd);. |
|00001c10| 20 78 6c 73 75 62 72 28 | 22 52 45 41 44 2d 43 48 | xlsubr(|"READ-CH|
|00001c20| 41 52 2d 4e 4f 2d 48 41 | 4e 47 22 2c 09 53 55 42 |AR-NO-HA|NG",.SUB|
|00001c30| 52 2c 09 78 72 64 6e 6f | 68 61 6e 67 29 3b 0d 0d |R,.xrdno|hang);..|
|00001c40| 20 20 20 20 2f 2a 20 73 | 65 74 75 70 20 67 6c 6f | /* s|etup glo|
|00001c50| 62 61 6c 73 20 66 6f 72 | 20 74 68 65 20 77 69 6e |bals for| the win|
|00001c60| 64 6f 77 20 68 61 6e 64 | 6c 65 73 20 2a 2f 0d 20 |dow hand|les */. |
|00001c70| 20 20 20 73 79 6d 20 3d | 20 78 6c 73 65 6e 74 65 | sym =| xlsente|
|00001c80| 72 28 22 2a 43 4f 4d 4d | 41 4e 44 2d 57 49 4e 44 |r("*COMM|AND-WIND|
|00001c90| 4f 57 2a 22 29 3b 0d 20 | 20 20 20 73 79 6d 2d 3e |OW*");. | sym->|
|00001ca0| 6e 5f 73 79 6d 76 61 6c | 75 65 20 3d 20 63 76 66 |n_symval|ue = cvf|
|00001cb0| 69 78 6e 75 6d 28 28 46 | 49 58 4e 55 4d 29 63 77 |ixnum((F|IXNUM)cw|
|00001cc0| 69 6e 64 6f 77 29 3b 0d | 20 20 20 20 73 79 6d 20 |indow);.| sym |
|00001cd0| 3d 20 78 6c 73 65 6e 74 | 65 72 28 22 2a 47 52 41 |= xlsent|er("*GRA|
|00001ce0| 50 48 49 43 53 2d 57 49 | 4e 44 4f 57 2a 22 29 3b |PHICS-WI|NDOW*");|
|00001cf0| 0d 20 20 20 20 73 79 6d | 2d 3e 6e 5f 73 79 6d 76 |. sym|->n_symv|
|00001d00| 61 6c 75 65 20 3d 20 63 | 76 66 69 78 6e 75 6d 28 |alue = c|vfixnum(|
|00001d10| 28 46 49 58 4e 55 4d 29 | 67 77 69 6e 64 6f 77 29 |(FIXNUM)|gwindow)|
|00001d20| 3b 0d 7d 0d 00 00 00 00 | 00 00 00 00 00 00 00 00 |;.}.....|........|
|00001d30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001d40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001d50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001d80| 00 00 01 00 00 00 01 1e | 00 00 00 1e 00 00 00 66 |........|.......f|
|00001d90| 4e ba fb 78 6c 75 6e 62 | 69 6e 64 0a 00 00 06 58 |N..xlunb|ind....X|
|00001da0| 8f 29 6e ff fc fd 78 6c | 73 74 61 63 6b 0a 00 00 |.)n...xl|stack...|
|00001db0| 08 6d 61 63 66 75 6e 2e | 63 00 02 00 00 00 54 45 |.macfun.|c.....TE|
|00001dc0| 58 54 45 44 49 54 00 00 | 00 00 00 00 00 00 00 00 |XTEDIT..|........|
|00001dd0| 00 00 54 45 58 54 45 44 | 49 54 00 00 00 00 00 00 |..TEXTED|IT......|
|00001de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001df0| 00 00 98 e4 48 5e 00 00 | 1c a4 00 00 01 84 ff fc |....H^..|........|
|00001e00| 48 6e 00 08 4e ba fb 78 | 6c 65 76 61 72 67 0a 00 |Hn..N..x|levarg..|
|00001e10| 00 1e 58 8f 2d 40 ff f4 | 2d 6e 00 08 ff ea 42 ae |..X.-@..|-n....B.|
|00001e20| ff e4 2f 2e ff f4 3f 3c | 00 04 48 6e ff b0 4e ba |../...?<|..Hn..N.|
|00001e30| fb 78 6c 62 65 67 69 6e | 0a 00 00 0a de fc 00 0a |.xlbegin|........|
|00001e40| 48 6e ff b6 4e ba fb 73 | 65 74 6a 6d 70 0a 00 00 |Hn..N..s|etjmp...|
|00001e50| 06 58 8f 4a 40 67 00 fc | 39 32 0a 00 00 02 2d 6c |.X.J@g..|92....-l|
|00001e60| fd 78 6c 76 61 6c 75 65 | 0a 00 00 04 ff e4 60 00 |.xlvalue|......`.|
|00001e70| fc 39 33 0a 00 00 ff 39 | 32 0a ff 39 34 0a 06 20 |.93....9|2..94.. |
|00001e80| 00 00 00 04 02 09 08 00 | 00 00 00 0a 00 09 06 4d |........|.......M|
|00001e90| 6f 6e 61 63 6f 00 00 00 | 00 04 00 06 00 08 00 00 |onaco...|........|
|00001ea0| 01 00 00 00 01 1e 00 00 | 00 1e 00 00 00 66 00 00 |........|.....f..|
|00001eb0| cc 24 03 50 00 00 00 1c | 00 5a 00 02 45 4f 50 54 |.$.P....|.Z..EOPT|
|00001ec0| 00 00 00 1a 45 46 4e 54 | 00 00 00 26 45 54 41 42 |....EFNT|...&ETAB|
|00001ed0| 00 00 00 32 03 ee 00 00 | 00 00 00 00 00 00 00 00 |...2....|........|
|00001ee0| 03 eb ff ff 00 00 00 08 | 00 01 9b 08 03 ec ff ff |........|........|
|00001ef0| 00 00 00 16 00 01 9b 10 | 0b 65 64 69 74 6f 72 20 |........|.editor |
|00001f00| 69 6e 66 6f 00 00 00 00 | 00 00 00 00 00 00 00 00 |info....|........|
|00001f10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+